from lib.sys.redis_factory import RedisFactory


class RedisClient(object):

    @staticmethod
    def delete(key):
        return RedisFactory.get_redis().delete(key)

    @staticmethod
    def set(key, value):
        RedisFactory.get_redis().set(key, value)

    @staticmethod
    def get(key):
        return RedisFactory.get_redis().get(key)

    @staticmethod
    def lpop(key):
        return RedisFactory.get_redis().lpop(key)

    @staticmethod
    def lpush(key, values):
        RedisFactory.get_redis().lpush(key, values)

    @staticmethod
    def rpop(key):
        return RedisFactory.get_redis().rpop(key)

    @staticmethod
    def rpush(key, values):
        RedisFactory.get_redis().rpush(key, values)

    @staticmethod
    def hset(name, key, value):
        RedisFactory.get_redis().hset(name, key, value)

    @staticmethod
    def hget(name, key):
        return RedisFactory.get_redis().hget(name, key)

    @staticmethod
    def hgetall(name):
        return RedisFactory.get_redis().hgetall(name)

    @staticmethod
    def hexists(name, key):
        return RedisFactory.get_redis().hexists(name, key)

    @staticmethod
    def hdel(name, *keys):
        return RedisFactory.get_redis().hdel(name, *keys)
